package cn.gov.pbc.dream.pojo.bo;

import lombok.Data;
import lombok.ToString;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.Date;

@Data
@ToString
public class PCDMessageBo {

    private String orgCode;

    private Date reportDate;

    private PCD1Bo pcd1Bo;

    public PCDMessageBo() {
        this.pcd1Bo = new PCD1Bo();
    }

    public void addPCD1InputStream(InputStream is) throws UnsupportedEncodingException {
        this.pcd1Bo.getBufferedReaderList().add(
                new BufferedReader(new InputStreamReader(is, "gb2312"))
        );
    }

    public void assemblePCD1Bo(String data) {
        pcd1Bo.assembleProductFundInfo(data);
    }
}
